import React from 'react'
// hooks函数，也来自于umi;
import { useNavigate } from 'umi'

export default function index() {
  const navigate = useNavigate()
    const loginHandler = ()=>{

        console.log('login is ok.')
        sessionStorage.isLogin = true;
        navigate("/home")
    }
  return (
    <div>   
        <h1>Login</h1>
        <button type='button' onClick = {loginHandler}>log in</button>
      
    </div>
  )
}
